// 测试链式队列
#include "LinkQueue.cpp"

int main() {
    LinkQueue<char> qu; //定义一个字符链队qu
    char e;
    cout << "Create an empty queue"<<endl;
    cout << "qu is " << (qu.empty() ? "empty" : "not empty") << endl;
    cout << "push a to queue" << endl; qu.push('a');
    cout << "push b to queue" << endl; qu.push('b');
    cout << "push c to queue" << endl; qu.push('c');
    cout << "push d to queue" << endl; qu.push('d');
    cout << "push e to queue" << endl; qu.push('e');
    cout << "qu is " << (qu.empty() ? "empty" : "not empty") << endl;
    cout << "dequeue order:";
    while(!qu.empty())  // 队不空循环
    {
        qu.pop(e);  // 出队元素e
        cout << e << " ";   // 输出元素e
    }
    cout << endl;
    cout << "destroy qu" << endl;

    return 0;
}
